import { request } from '@/utils';
import { getRestBaseUrl } from '@/config';

// 新增
export const save = baseGoods =>
  request({
    url: `${getRestBaseUrl()}/iop/priceBaseGoodsService/save`,
    method: 'POST',
    data: { baseGoods },
    timeout: 3 * 60 * 1000,
  });

// 修改
export const update = baseGoods =>
  request({
    url: `${getRestBaseUrl()}/iop/priceBaseGoodsService/update`,
    method: 'POST',
    data: { baseGoods },
    timeout: 3 * 60 * 1000,
  });

// 商品名称
export const getGoodsName = (topChannelCode, goodsCode) =>
  request({
    url: `${getRestBaseUrl()}/iop/priceBaseGoodsService/getGoodsName`,
    method: 'POST',
    data: { topChannelCode, goodsCode },
    timeout: 3 * 60 * 1000,
  });
